package com.example.graphicslib.animations;

import android.graphics.Matrix;

import com.example.graphicslib.utils.RotationDirection;

/**
 * Created by Tatev on 24/4/2014.
 */
public class BaseMovementRotationAnimation extends BaseMovementAnimation implements Rotatable {
    public BaseMovementRotationAnimation(float startX, float startY, long duration,
                                         int rotationCount, RotationDirection direction, float width, float height) {
        super(startX, startY, duration);
        rotationAnimation = new BaseRotationAnimation(rotationCount, direction, width, height, duration);
        rotationAnimation.setCoordinates(startX, startY);
    }

    @Override
    public void setRotationCount(int rotationCount) {

    }

    @Override
    public void setRotationDirection(RotationDirection direction) {

    }

    @Override
    public Matrix getRotationMatrix() {
        rotationAnimation.setCoordinates(getCurrentX(), getCurrentY());
        return rotationAnimation.getRotationMatrix();
    }

    @Override
    public void onTickResponse(long elapsedTime) {
        super.onTickResponse(elapsedTime);
        rotationAnimation.onTickResponse(elapsedTime);
    }

    private BaseRotationAnimation rotationAnimation;
}
